﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dubbo.Rpc
{
    public interface IInvocation
    {
        /**
	     * get method name.
	     * 
	     * @serial
	     * @return method name.
	     */
        string MethodName { get; set; }

        /**
         * get parameter types.
         * 
         * @serial
         * @return parameter types.
         */
        Type[] ParameterTypes { get; set; }

        /**
         * get arguments.
         * 
         * @serial
         * @return arguments.
         */
        object[] Arguments { get; set; }

        /**
         * get attachments.
         * 
         * @serial
         * @return attachments.
         */
        Dictionary<string, string> Attachments { get; set; }

        /**
         * get attachment by key.
         * 
         * @serial
         * @return attachment value.
         */
        string GetAttachment(string key);

        /**
         * get attachment by key with default value.
         * 
         * @serial
         * @return attachment value.
         */
        string GetAttachment(string key, string defaultValue);
    }

    public interface IInvocation<T> : IInvocation
    {
        /**
         * get the invoker in current context.
         * 
         * @transient
         * @return invoker.
         */
        IInvoker<T> Invoker { get; }
    }
}
